<?php $this->load->view("admin/$adminCurrentTemplate/commonHead")?>
    	<ul>
        	<li class="guid">
            	<ul>
                    <li class="chkBox"><input type="checkbox" name="all" id="all" /></li>
                    <li class="create-time">创建时间</li>
                    <li class="index">排序索引</li>
                    <li class="cate">上级菜单</li>
                    <li class="title">菜单名称</li>
                </ul>
            </li>
            <form name="listForm" id="listForm" method="post" action="<?php echo $phpSelf;?>">
            <input type="hidden" name="del" id="del" value="" />
            <input type="hidden" name="active" id="active" value="" />
            <?php 
            if(count($adminMenuList)>0){
            	foreach($adminMenuList as $item):
            ?>            
        	<li class="item">
            	<ul>
            		<li class="chkBox"><input type="checkbox" name="id[]" id="id_<?php echo $item->id?>" class="id-checkbox" value="<?php echo $item->id?>" /></li>
                    <li class="create-time" title="<?php echo $item->createTime;?>"><?php echo date('Y-m-d',strtotime($item->createTime));?></li>
                    <li class="index"><input type="text" name="index" id="index_<?=$item->id?>" value="<?=$item->oIndex?>" class="index-input" /></li>
                    <li class="cate"><?php echo $item->parentTitle?></li>
                    <li class="title" title="<?php echo $item->title;?>"><?php echo $item->title?></li>
                    <li class="single-menu"><a href="#" title="修改" class="edit">修改</a><a href="#" title="删除" class="del">删除</a></li>
                </ul>
            </li>
            <?php 
            	endforeach;
            ?>
            <div class="apptend-container hide"></div>
            </form>
            <li class="page">
            	<?php echo $this->pagination->create_links();?>
            </li>
            <?php 
            }else{            
            ?>
            <div class="apptend-container hide"></div>
            </form>
            <li class='no-list'>对不起，暂无数据！</li>
            <?php }?>
        </ul>
        <div class="moveBox hide">
			<div class="search-box-row">
				<span class="guid">移 动 至：</span>
				<span class="formItem">
					<select size="1" name="parentId" id="parentId" class="single-select">
						<option value="0" selected="selected">顶级菜单</option>
						<?php 
						$str = '';
						foreach ($adminMenuAll as $value){
							$str .= "<option value=\"".$value->id."\"";
							if($value->id==$parentId){
								$str .= " selected=\"selected\"";
							}
							$str .=">"; 
							for($i=0;$i<$value->deep;$i++){
								$str .= "&nbsp;|-";
							} 
							$str .= $value->title."</option>\n"; 
						}
						echo $str;
						?>
					</select>
				</span>
			</div>
        </div>
		<div class="searchBox hide">
			<div class="search-box-row">
				<span class="guid">启用状态：</span>
				<span class="formItem">
					<input type="radio" name='disabled' id='disabled_' value=''<?php if(strlen($disabled)==0) echo " checked='checked'";?> /><label for='disabled_'>所有</label>
					<input type="radio" name='disabled' id='disabled_0' value="0"<?php if($disabled=='0' && strlen($disabled)>0) echo "checked='checked'";?> /><label for="disabled_0">启用</label>
					<input type='radio' name='disabled' id='disabled_1' value='1'<?php if($disabled=='1') echo "checked='checked'";?> /><label for="disabled_1">禁用</label>
				</span>
			</div>
			<div class="search-box-row">
				<span class="guid">上级菜单：</span>
				<span class="formItem">
					<select size="1" name="parentId" id="parentId" class="single-select">
						<option value="" selected="selected">所有菜单</option>
						<?php 
						$str = '';
						foreach ($adminMenuAll as $value){
							$str .= "<option value=\"".$value->id."\"";
							if($value->id==$parentId){
								$str .= " selected=\"selected\"";
							}
							$str .=">"; 
							for($i=0;$i<$value->deep;$i++){
								$str .= "&nbsp;|-";
							} 
							$str .= $value->title."</option>\n"; 
						}
						echo $str;
						?>
					</select>
				</span>
			</div>
			<div class="search-box-row">
				<span class="guid">菜单名称：</span>
				<span class="formItem"><input type="text" name="title" id="title" value="<?php if(isset($title)) echo $title;?>" class="txtBox" /></span>
			</div>
			<div class="search-box-row">
				<span class="guid">标 识 符：</span>
				<span class="formItem"><input type="text" name="identifier" id="identifier" value="<?php if(isset($identifier)) echo $identifier;?>" class="txtBox" /></span>
			</div>
			<div class="search-box-row">
				<span class="guid">链接地址：</span>
				<span class="formItem"><input type="text" name="url" id="url" value="<?php if(isset($url)) echo $url;?>" class="txtBox" /></span>
			</div>
			<div class="search-box-row">
				<span class="guid">添加时间：</span>
				<span class="formItem"><input type="text" name="createTimeStart" id="createTimeStart" value="<?php if(isset($createTimeStart)) echo $createTimeStart;?>" class="timeBox" onClick="WdatePicker();" readonly="readonly" /><label>至</label><input type="text" name="createTimeEnd" id="createTimeEnd" value="<?php if(isset($createTimeEnd)) echo $createTimeEnd;?>" class="timeBox" onClick="WdatePicker();" readonly="readonly" /></span>
			</div>
		</div>

<script type="text/javascript">
var editWidth = 400;
var editHeight = 205;
var searchWidth = 315;
var searchHeight = 231;
var dialogSelectId = 'parentId';
$(function(){
	$('.apptend-container').html($('.searchBox').html());
});
</script>
<?php $this->load->view("admin/$adminCurrentTemplate/commonFoot");?>

<script type="text/javascript">
$(function(){
	$(".main > .position > ul > .menu_move > ul a").each(function(i){
		if(i>=3){$(this).remove();}
	});
	$(".main > .position > ul > .menu_move > ul").height(66);	
	var page_disabled = $('.apptend-container input[name="disabled"]:checked').val();
	var page_parentId = $('.apptend-container #parentId').val();
	var page_title = $('.apptend-container #title').val();
	var page_identifier = $('.apptend-container #identifier').val();
	var page_url = $('.apptend-container #url').val();
	var page_createTimeStart = $('.apptend-container #createTimeStart').val();
	var page_createTimeEnd = $('.apptend-container #createTimeEnd').val();
	var paramSplit = '&';
	var paramString = '';
	if(page_disabled.length>0){
		if(paramString.length>0){
			paramString += paramSplit;
		}
		paramString += 'disabled=' + page_disabled;
	}
	if(page_parentId.length>0){
		if(paramString.length>0){
			paramString += paramSplit;
		}
		paramString += 'parentId=' + page_parentId;
	}
	if(page_title.length>0){
		if(paramString.length>0){
			paramString += paramSplit;
		}
		paramString += 'title=' + page_title;
	}
	if(page_identifier.length>0){
		if(paramString.length>0){
			paramString += paramSplit;
		}
		paramString += 'identifier=' + page_identifier;
	}
	if(page_url.length>0){
		if(paramString.length>0){
			paramString += paramSplit;
		}
		paramString += 'url=' + page_url;
	}
	if(page_createTimeStart.length>0){
		if(paramString.length>0){
			paramString += paramSplit;
		}
		paramString += 'createTimeStart=' + page_createTimeStart;
	}
	if(page_createTimeEnd.length>0){
		if(paramString.length>0){
			paramString += paramSplit;
		}
		paramString += 'createTimeEnd=' + page_createTimeEnd;
	}
	
	$('.page a').each(function(){
		var self = $(this);
		var selfHref = self.attr('href');
		if(paramString.length>0){
			self.attr('href',selfHref + '?' + paramString);
		}
	});
});
</script>